from __future__ import absolute_import
from __future__ import division
from __future__ import print_function

import warnings
warnings.filterwarnings("ignore")

import os
os.environ["CUDA_VISIBLE_DEVICES"] = "0"

from options import Options
from lib.data import Dataset
from lib.gan_noall import GAN_NOALL


def train_gan_noall():
    # ARGUMENTS
    opt = Options().parse()
    # opt.resume = True  # resume = True 初始化时会先加载，继续训练，模型没有保存epoch，需要重新设置， 暂时全部都是重新训练
    # LOAD DATA
    dataset = Dataset(opt.data_name, opt.data_type, opt.seq_len, opt.indicators, opt.masked_indicator)

    # LOAD MODEL
    model = GAN_NOALL(opt, dataset)

    # TRAIN MODEL
    model.train()
    masked_data = dataset.load_masked_data()
    model.imputation(masked_data)


if __name__ == '__main__':
    train_gan_noall()
